package com.hystrix;

import com.hystrix.command.HelloCommand;

/**
 * 请先启动当前项目的Spirng Boot
 * Created by earl on 2018/4/28.
 */
public class Test {

        public static void main(String [] args){
//            testNormal();
            testError();
        }

        //测试正常的http服务
        public static  void testNormal(){
            String helloUrl = "http://localhost:8080/hello";
            HelloCommand command = new HelloCommand(helloUrl);
            System.out.println("请求正常的服务："+ command.execute());
        }

    //测试异常的http服务
    public static  void testError(){
        String helloUrl = "http://localhost:8080/errorHello";
        HelloCommand command = new HelloCommand(helloUrl);
        System.out.println("请求异常的HTTP服务："+ command.execute());
    }

}
